﻿Imports IICBusinessLogic

Public Class UIGradeChangedValidator
    Inherits GradeChangedValidator

    Public Overrides Sub validate(ByVal mo As org.model.lib.Model.IModelObject)

        MyBase.validate(mo)

        Dim cm As ClassMember = CType(mo, ClassMember)
        If (cm.gradeChangeNeedsRecalculation) Then
            winUtils.MsgboxInfo( _
                "You need to re-process this period for diplomas. Grade was changed from fail:{0} to pass: {1}", _
                    CStr(cm.originalGrade.GetValueOrDefault), _
                    CStr(cm.Grade.GetValueOrDefault))
        End If

        If (cm.gradeChangeProcessingWasReversed) Then
            winUtils.MsgboxInfo("You need to re-process this period for diplomas. Grade was changed from pass {0} to fail {1}", _
                        CStr(cm.originalGrade.GetValueOrDefault), _
                    CStr(cm.Grade.GetValueOrDefault))
        End If

    End Sub
End Class
